From ad622355143a8cd3fee23810ea13b8a109a191f9 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Fri, 27 Apr 2007 10:44:11 +0100 Subject: [PATCH] [XEND] Start cleanly even with bad xml state files signed-off-by: Tom Wilkie --- tools/python/xen/xend/XendNode.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/python/xen/xend/XendNode.py b/tools/python/xen/xend/XendNode.py index f6e98bfbff..44aaa1bbc8 100644 --- a/tools/python/xen/xend/XendNode.py +++ b/tools/python/xen/xend/XendNode.py @@ -141,7 +141,10 @@ class XendNode: saved_networks = self.state_store.load_state('network') if saved_networks: for net_uuid, network in saved_networks.items(): - XendNetwork.recreate(network, net_uuid) + try: + XendNetwork.recreate(network, net_uuid) + except CreateUnspecifiedAttributeError: + log.warn("Error recreating network %s", net_uuid) # Next discover any existing bridges and check # they are not already configured @@ -161,8 +164,11 @@ class XendNode: saved_pifs = self.state_store.load_state('pif') if saved_pifs: for pif_uuid, pif in saved_pifs.items(): - XendPIF.recreate(pif, pif_uuid) - + try: + XendPIF.recreate(pif, pif_uuid) + except CreateUnspecifiedAttributeError: + log.warn("Error recreating PIF %s", pif_uuid) + # Next discover any existing PIFs and check # they are not already configured configured_pifs = [XendAPIStore.get( @@ -217,7 +223,10 @@ class XendNode: saved_pbds = self.state_store.load_state('pbd') if saved_pbds: for pbd_uuid, pbd_cfg in saved_pbds.items(): - XendPBD.recreate(pbd_uuid, pbd_cfg) + try: + XendPBD.recreate(pbd_uuid, pbd_cfg) + except CreateUnspecifiedAttributeError: + log.warn("Error recreating PBD %s", pbd_uuid) ## def network_destroy(self, net_uuid): ## del self.networks[net_uuid] -- 2.30.2